# CMake 要求最低版本
cmake_minimum_required(VERSION 3.10)

# 项目信息
project(sortAlgorithm)

# 配置头文件
configure_file(
    "${PROJECT_SOURCE_DIR}/config.h.in"
    "${PROJECT_SOURCE_DIR}/config.h"
)

# 是否使用自己的排序
option(USE_MY_SORT "Use provided sort implementation" ON)

# 是否加入 SortAlgorithm 库
if(USE_MY_SORT)
    include_directories("${PROJECT_SOURCE_DIR}/sort")
    add_subdirectory(sort)
    set(EXTRA_LIBS ${EXTRA_LIBS} sort)
endif(USE_MY_SORT)

aux_source_directory(. DIR_SRCS)

# 指定生成目标
add_executable(main ${DIR_SRCS})
target_link_libraries(main ${EXTRA_LIBS})

